<template>
      <router-view>
        
      </router-view>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
const { t, locale } = useI18n()
const route = useRoute();

// 从 localStorage 获取保存的语言设置
const savedLocale = localStorage.getItem('locale')
if (savedLocale) {
  locale.value = savedLocale
}

watchEffect(()=> {
  const language = route.query.language as string
  if (language) {
    locale.value = language
    // 将新的语言设置保存到 localStorage
    localStorage.setItem('locale', language)
  }
})
</script>

<style scoped lang="scss">
</style>

